package com.car.service.TgTurnover.impl;

import java.util.List;

import javax.annotation.Resource;

import com.car.dal.dao.turnover.TgTurnoverDao;
import com.car.dal.object.TgTurnover;
import com.car.service.TgTurnover.TgTurnoverService;
import com.car.util.Page;

public class TgTurnoverServiceImpl implements TgTurnoverService {
	
	@Resource
	private TgTurnoverDao tgTurnoverDao;

	@Override
	public Long AddTgTurnover(TgTurnover turnover) {
		Long i = tgTurnoverDao.insert(turnover);
		return i;
	}

	@Override
	public List<TgTurnover> findTurnoverList(TgTurnover turnover,Page page) {
		turnover.setFirstrownum(page.getFirstrownum());
		turnover.setPagesize(page.getPagesize());
		List<TgTurnover> list = tgTurnoverDao.findByLoginName(turnover);
		return list;
	}
	
	@Override
	public Integer getPreCountByType(TgTurnover turnover) {
		return tgTurnoverDao.getPreCountByType(turnover);
		
	}

	@Override
	public boolean update(TgTurnover turnover) {
		boolean i = tgTurnoverDao.update(turnover);
		return i;
	}

	@Override
	public List<TgTurnover> findByEximple(TgTurnover turnover) {
		List<TgTurnover> list = tgTurnoverDao.findByExample(turnover);
		return list;
	}

	@Override
	public boolean deleteId(TgTurnover turnover) {
		boolean b = tgTurnoverDao.delete(turnover);
		return b;
	}

}
